#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QString>
#include <QDir>

#include "downloader.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    
private slots:
    void on_urlLineEdit_textChanged(const QString);

    void on_browseButton_clicked();

    void on_savePathLineEdit_textChanged(const QString &path);

    void on_startButton_clicked();

    void downloadFinished();
    void onDownloadError(QString error);

    void on_fileNameLineEdit_textChanged(const QString &fileName);

private:
    Ui::MainWindow *ui;
    Downloader* downloader;

    QDir saveDir;            // directory in which to save downloaded file
};

#endif // MAINWINDOW_H
